package com.jzo2o.customer.controller.worker;

import com.jzo2o.common.model.CurrentUserInfo;
import com.jzo2o.common.utils.JwtTool;
import com.jzo2o.customer.model.domain.WorkerCertification;
import com.jzo2o.customer.model.domain.WorkerCertificationAudit;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditResDTO;
import com.jzo2o.customer.service.IWorkerCertificationService;
import com.jzo2o.customer.service.WorkerCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author DarkClown
 * @date 2024-08-19 21:23
 * @project_name jzo2o-customer
 * @parem
 **/
@RestController("workerCertificationAuditController")
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端 - 设置银行账户接口设计")
public class WorkerCertificationAuditController {
    @Autowired
    IWorkerCertificationService workerCertificationService;

    @Autowired
    WorkerCertificationAuditService workerCertificationAuditService;

    @Autowired
    JwtTool jwtTool;

    @PostMapping
    @ApiOperation("服务端提交认证接口")
    public void workerCertificationAudit(
         @RequestBody WorkerCertificationAudit workerCertificationAudit,@RequestHeader("Authorization") String token) {
        //解析token

        CurrentUserInfo currentUserInfo = jwtTool.parseToken(token);

        workerCertificationAudit.setServeProviderId(currentUserInfo.getId());

        workerCertificationAuditService.saveOrUpdate(workerCertificationAudit);

    }





}
